//
//  RegisterOperation.m
//  PlayBall
//
//  Created by Edward Zhang on 12-5-18.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import "JddRegisterOperation.h"
#import "JddParameterBuilder.h"

@implementation JddRegisterOperation

@synthesize userName;
@synthesize userPassword;
@synthesize cmdID;

-(void)main{
    JddNetDataCommunication *netDataCommunication = [[JddNetDataCommunication alloc] init];
    
    NSString *bodyString = [JddParameterBuilder registerParameterWithUserName:self.userName userPassword:self.userPassword cmdID:[self.cmdID intValue]];
    
    NSData *dataRegister = [netDataCommunication requestDataByPostBodyData:[bodyString dataUsingEncoding:NSUTF8StringEncoding]];
    [((NSObject*)self.delegate) performSelectorOnMainThread:@selector(RegisterOperationResult:) withObject:dataRegister waitUntilDone:NO];    
}

@end
